//
//  ImageUtil.m
//  九个头条
//
//  Created by HZ on 14-6-14.
//  Copyright (c) 2014年 cn.huiz. All rights reserved.
//

#import "ImageUtil.h"
#import "UIImageView+WebCache.h"
#import "NSString+DF.h"
@implementation ImageUtil

+ (void)downloadImage:(NSString *)url placeholder:(UIImage *)place imageView:(UIImageView *)imageView
{
    if(![url isKindOfClass:[NSString class]] || [url isEmpty]) {
        imageView.image = place;
        return;
    }
    [imageView setImageWithURL:[NSURL URLWithString:url] placeholderImage:place options:SDWebImageLowPriority | SDWebImageRetryFailed];
}

+ (void)clear
{
    // 1.清除内存中的缓存图片
    [[SDImageCache sharedImageCache] clearMemory];
    
    // 2.取消所有的下载请求
    [[SDWebImageManager sharedManager] cancelAll];
}
@end
